import { get, post, del, put } from "@/utils/request";
import {  addressAddData,  addressListData,  addressListReturn, addressParams } from "./type";

// 地址列表
export const addressList = (data: addressParams) => {
  return get<addressParams, addressListReturn>("/api/address/list", data);
};

// 地址添加
export const addressAdd = (data: addressAddData) => {
  return post<addressAddData, addressListData>("/api/address/add", data);
};

// 地址编辑
export const addressUpdate = (data: addressListData) => {
  return put<addressAddData, addressListData>("/api/address/update", data);
};

// 地址删除
export const addressDel = (id: number) => {
  return del<number, null>(`/api/address/delete/${id}`);
};

// 地址批删
export const addressDelAll = (data: number[]) => {
  return post<number[], null>("/api/address/deleteAll", data);
};
